home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group92c.txt
/
000107_icon-group-sender _Tue Dec 15 10:44:24 1992.msg
< prev
next >
Wrap
Internet Message Format
|
1993-01-04
|
2KB
Received: by cheltenham.cs.arizona.edu; Tue, 15 Dec 1992 05:28:56 MST
Via: uk.ac.edinburgh.festival; Tue, 15 Dec 1992 10:44:33 +0000
Date: 15 Dec 92 10:44:24 GMT
From: R J Hare <ercn72@festival.ed.ac.uk>
Subject: Problem with XIcon syntax.
To: icon-group@cs.arizona.edu
Message-Id: <9212151044.aa28611@uk.ac.ed.festival>
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
I have a minor problem with XIcon syntax - can anyone help?
I wish to execute a loop, the culmination of which is the drawing of a single
point in the XWindow. I wish to be able to terminate execution of the loop and
move to the next phase of the program at any point (ie: with the picture
incomplete) by pressing a button on my mouse. I reackon the code should look
something like this:
procedure main()
.
every i:=1 to n
do {if XEvent(window)==&lpress then break # force a break if lb is pressed
.
loop code culminating in
XDrawPoint(window,x,y)}}
.
remainder of code
.
end
This seems to get in some sort of hung-up situation - I see no points being
drawn in my window and pressing the left mouse button doesn't seem to exit
from the loop either.
The following code works, but doesn't seem so intuitive:
every i:=1 to n
do {if (events:=XPending(window) & *events > 0) # force a
then if XEvents(window)==&lpress # break if left
then break # button pressed
.
loop code culminating in
XDrawPoint(window,x,y)}}
.
remainder of code
.
end
Should the first form of the code work, or what?
Thanks.
Roger Hare.